package com.cwj.vm;

import org.openjdk.jol.info.ClassLayout;
import org.openjdk.jol.vm.VM;

import java.util.concurrent.TimeUnit;

/**
 * @author: Chenwujie
 * @date: 2021-05-28 13:12
 */
public class SyncLockTest {
    public static void main(String[] args) {
        try {
            TimeUnit.SECONDS.sleep(10);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println(VM.current().details());
        Object o = new Object();
        System.out.println(Integer.toBinaryString(Object.class.hashCode()));
        System.out.println(ClassLayout.parseInstance(o).toPrintable());
        synchronized (o){
            System.out.println(ClassLayout.parseInstance(o).toPrintable());
        }
    }
}
